/**
 * 清单梳理中 地址的apijs 文件
 */

import request from "@/utils/request";

/**
 * 保存或修改地址信息
 * @param {*} data
 */
export function saveOrUpdateDealWithAddress(data) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/yxpz/dealWithAddress/saveOrUpdate",
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    },
    data: data
  });
}

/**
 * 查询所有地址供清单选择
 */
export function queryAllDealWithAddress() {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH + "/yxpz/dealWithAddress/queryByAll",
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}

/**
 * 根据HDLOid查询关联的地址的dwaIds
 * @param {*} hdlOid
 */
export function queryDwaOidsByHdlOid(hdlOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/yxpz/detailListDealWithAddressRel/queryDwaOidsByHdlOid/${hdlOid}`,
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}

/**
 * 保存清单和地址的关联关系
 * @param {*} params
 */
export function saveOrUpdateDetailListDealWithAddressRel(params) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/yxpz/detailListDealWithAddressRel/saveOrUpdate",
    method: "get",
    params: params
  });
}

/**
 * 根据id查询地址对象数据
 * @param {*} id
 */
export function getByIdDealWithAddress(id) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/yxpz/dealWithAddress/getById/${id}`,
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}

/**
 * 根据id删除地址数据
 * @param {*} id
 */
export function deleteByIdDealWithAddress(id) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/yxpz/dealWithAddress/deleteById/${id}`,
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}
